package com.maxwell.googleplay.holder;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.maxwell.googleplay.R;
import com.maxwell.googleplay.utils.UIUtils;

import android.view.View;
import android.widget.LinearLayout;

/**
 * @author yue
 * @创建时间 2016-3-31下午9:31:57
 * @描述 TODO
 * 
 */
public class LoadMoreHolder extends BaseHolder<Integer> {

	@ViewInject(R.id.item_loadmore_container_loading)
	LinearLayout mContainerLoading;
	@ViewInject(R.id.item_loadmore_container_retry)
	LinearLayout mContainerRetry;

	public static final int STATE_LOADING = 0;
	public static final int STATE_RETRY = 1;
	public static final int STATE_NONE = 2;

	@Override
	public View initHolderView() {

		View view = View.inflate(UIUtils.getContext(), R.layout.item_loadmore,
				null);
		ViewUtils.inject(this, view);
		return view;
	}

	@Override
	public void refreshHolderView(Integer state) {
		mContainerLoading.setVisibility(View.GONE);
		mContainerRetry.setVisibility(View.GONE);
		

		switch (state) {
		case STATE_LOADING:
			mContainerLoading.setVisibility(View.VISIBLE);
	
			break;
		case STATE_RETRY:
			
			mContainerRetry.setVisibility(View.VISIBLE);
			break;
		case STATE_NONE:

			break;

		default:
			break;
		}

	}

}
